// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate api;
extern crate async_trait;
extern crate bytes;
extern crate gax;
extern crate gaxi;
extern crate lazy_static;
extern crate reqwest;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;

mod debug;
mod deserialize;
mod serialize;

/// The request message for the `RegisterIcebergTable` API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RegisterIcebergTableRequest {
    /// Required. Table to register in the format:
    /// `projects/{project_id}/catalogs/{catalog_id}/namespaces/{namespace}`.
    pub parent: std::string::String,

    /// Required. The name of the table to register.
    pub name: std::string::String,

    /// Required. The metadata location of the table.
    pub metadata_location: std::string::String,

    /// Optional. Whether to overwrite the table if it already exists. Default is
    /// false. Currently this field is ignored and an error is returned if the
    /// table already exists.
    pub overwrite: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RegisterIcebergTableRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::RegisterIcebergTableRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [name][crate::model::RegisterIcebergTableRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [metadata_location][crate::model::RegisterIcebergTableRequest::metadata_location].
    pub fn set_metadata_location<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.metadata_location = v.into();
        self
    }

    /// Sets the value of [overwrite][crate::model::RegisterIcebergTableRequest::overwrite].
    pub fn set_overwrite<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.overwrite = v.into();
        self
    }
}

impl wkt::message::Message for RegisterIcebergTableRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.RegisterIcebergTableRequest"
    }
}

/// The Iceberg REST Catalog information.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IcebergCatalog {
    /// Identifier. The catalog name, `projects/my-project/catalogs/my-catalog`.
    /// This field is immutable.
    /// This field is ignored for CreateIcebergCatalog.
    pub name: std::string::String,

    /// Optional. The credential mode for the catalog.
    pub credential_mode: crate::model::iceberg_catalog::CredentialMode,

    /// Output only. The service account used for credential vending, output only.
    /// Might be empty if Credential vending was never enabled for the catalog.
    pub biglake_service_account: std::string::String,

    /// Required. The catalog type. Required for CreateIcebergCatalog.
    pub catalog_type: crate::model::iceberg_catalog::CatalogType,

    /// Optional. The default location for the catalog. For the Google Cloud
    /// Storage Bucket catalog this is output only.
    pub default_location: std::string::String,

    /// Output only. The GCP region(s) where the catalog metadata is stored.
    /// This will contain one value for all locations, except for the catalogs that
    /// are configured to use custom dual region buckets.
    pub catalog_regions: std::vec::Vec<std::string::String>,

    /// Output only. When the catalog was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. When the catalog was last updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl IcebergCatalog {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::IcebergCatalog::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [credential_mode][crate::model::IcebergCatalog::credential_mode].
    pub fn set_credential_mode<
        T: std::convert::Into<crate::model::iceberg_catalog::CredentialMode>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.credential_mode = v.into();
        self
    }

    /// Sets the value of [biglake_service_account][crate::model::IcebergCatalog::biglake_service_account].
    pub fn set_biglake_service_account<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.biglake_service_account = v.into();
        self
    }

    /// Sets the value of [catalog_type][crate::model::IcebergCatalog::catalog_type].
    pub fn set_catalog_type<T: std::convert::Into<crate::model::iceberg_catalog::CatalogType>>(
        mut self,
        v: T,
    ) -> Self {
        self.catalog_type = v.into();
        self
    }

    /// Sets the value of [default_location][crate::model::IcebergCatalog::default_location].
    pub fn set_default_location<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.default_location = v.into();
        self
    }

    /// Sets the value of [catalog_regions][crate::model::IcebergCatalog::catalog_regions].
    pub fn set_catalog_regions<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.catalog_regions = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [create_time][crate::model::IcebergCatalog::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::IcebergCatalog::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::IcebergCatalog::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::IcebergCatalog::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for IcebergCatalog {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.IcebergCatalog"
    }
}

/// Defines additional types related to [IcebergCatalog].
pub mod iceberg_catalog {
    #[allow(unused_imports)]
    use super::*;

    /// Determines the catalog type.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum CatalogType {
        /// Default value. This value is unused.
        Unspecified,
        /// Catalog type for Google Cloud Storage Buckets.
        GcsBucket,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [CatalogType::value] or
        /// [CatalogType::name].
        UnknownValue(catalog_type::UnknownValue),
    }

    #[doc(hidden)]
    pub mod catalog_type {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl CatalogType {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::GcsBucket => std::option::Option::Some(1),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("CATALOG_TYPE_UNSPECIFIED"),
                Self::GcsBucket => std::option::Option::Some("CATALOG_TYPE_GCS_BUCKET"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for CatalogType {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for CatalogType {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for CatalogType {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::GcsBucket,
                _ => Self::UnknownValue(catalog_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for CatalogType {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "CATALOG_TYPE_UNSPECIFIED" => Self::Unspecified,
                "CATALOG_TYPE_GCS_BUCKET" => Self::GcsBucket,
                _ => Self::UnknownValue(catalog_type::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for CatalogType {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::GcsBucket => serializer.serialize_i32(1),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for CatalogType {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CatalogType>::new(
                ".google.cloud.biglake.v1.IcebergCatalog.CatalogType",
            ))
        }
    }

    /// The credential mode used for the catalog.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum CredentialMode {
        /// Default value. This value is unused.
        Unspecified,
        /// End user credentials, default. The authenticating user must have access
        /// to the catalog resources and the corresponding Google Cloud Storage
        /// files.
        EndUser,
        /// Use credential vending. The authenticating user must have access to the
        /// catalog resources and the system will provide the caller with downscoped
        /// credentials to access the Google Cloud Storage files. All table
        /// operations in this mode would require `X-Iceberg-Access-Delegation`
        /// header with `vended-credentials` value included. System will generate a
        /// service account and the catalog administrator must grant the service
        /// account appropriate permissions.
        ///
        /// See:
        /// <https://github.com/apache/iceberg/blob/931865ecaf40a827f9081dddb675bf1c95c05461/open-api/rest-catalog-open-api.yaml#L1854>
        /// for more details.
        VendedCredentials,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [CredentialMode::value] or
        /// [CredentialMode::name].
        UnknownValue(credential_mode::UnknownValue),
    }

    #[doc(hidden)]
    pub mod credential_mode {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl CredentialMode {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::EndUser => std::option::Option::Some(1),
                Self::VendedCredentials => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("CREDENTIAL_MODE_UNSPECIFIED"),
                Self::EndUser => std::option::Option::Some("CREDENTIAL_MODE_END_USER"),
                Self::VendedCredentials => {
                    std::option::Option::Some("CREDENTIAL_MODE_VENDED_CREDENTIALS")
                }
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for CredentialMode {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for CredentialMode {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for CredentialMode {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::EndUser,
                2 => Self::VendedCredentials,
                _ => Self::UnknownValue(credential_mode::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for CredentialMode {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "CREDENTIAL_MODE_UNSPECIFIED" => Self::Unspecified,
                "CREDENTIAL_MODE_END_USER" => Self::EndUser,
                "CREDENTIAL_MODE_VENDED_CREDENTIALS" => Self::VendedCredentials,
                _ => Self::UnknownValue(credential_mode::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for CredentialMode {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::EndUser => serializer.serialize_i32(1),
                Self::VendedCredentials => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for CredentialMode {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CredentialMode>::new(
                ".google.cloud.biglake.v1.IcebergCatalog.CredentialMode",
            ))
        }
    }
}

/// The request message for the `CreateIcebergCatalog` API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateIcebergCatalogRequest {
    /// Required. The parent resource where this catalog will be created.
    /// Format: projects/{project_id}
    pub parent: std::string::String,

    /// Required. The name of the catalog.
    pub iceberg_catalog_id: std::string::String,

    /// Required. The catalog to create.
    /// The required fields for creation are:
    ///
    /// - catalog_type.
    ///   Optionally: credential_mode can be provided, if Credential Vending is
    ///   desired.
    pub iceberg_catalog: std::option::Option<crate::model::IcebergCatalog>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateIcebergCatalogRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateIcebergCatalogRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [iceberg_catalog_id][crate::model::CreateIcebergCatalogRequest::iceberg_catalog_id].
    pub fn set_iceberg_catalog_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.iceberg_catalog_id = v.into();
        self
    }

    /// Sets the value of [iceberg_catalog][crate::model::CreateIcebergCatalogRequest::iceberg_catalog].
    pub fn set_iceberg_catalog<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::IcebergCatalog>,
    {
        self.iceberg_catalog = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [iceberg_catalog][crate::model::CreateIcebergCatalogRequest::iceberg_catalog].
    pub fn set_or_clear_iceberg_catalog<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::IcebergCatalog>,
    {
        self.iceberg_catalog = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreateIcebergCatalogRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.CreateIcebergCatalogRequest"
    }
}

/// The request message for the `DeleteIcebergCatalog` API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteIcebergCatalogRequest {
    /// Required. The catalog to delete.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteIcebergCatalogRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteIcebergCatalogRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DeleteIcebergCatalogRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.DeleteIcebergCatalogRequest"
    }
}

/// The request message for the `UpdateIcebergCatalog` API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateIcebergCatalogRequest {
    /// Required. The catalog to update.
    pub iceberg_catalog: std::option::Option<crate::model::IcebergCatalog>,

    /// Optional. The list of fields to update.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateIcebergCatalogRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [iceberg_catalog][crate::model::UpdateIcebergCatalogRequest::iceberg_catalog].
    pub fn set_iceberg_catalog<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::IcebergCatalog>,
    {
        self.iceberg_catalog = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [iceberg_catalog][crate::model::UpdateIcebergCatalogRequest::iceberg_catalog].
    pub fn set_or_clear_iceberg_catalog<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::IcebergCatalog>,
    {
        self.iceberg_catalog = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateIcebergCatalogRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateIcebergCatalogRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateIcebergCatalogRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.UpdateIcebergCatalogRequest"
    }
}

/// The request message for the `GetIcebergCatalog` API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetIcebergCatalogRequest {
    /// Required. The catalog to get.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetIcebergCatalogRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetIcebergCatalogRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetIcebergCatalogRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.GetIcebergCatalogRequest"
    }
}

/// The request message for the `ListIcebergCatalogs` API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListIcebergCatalogsRequest {
    /// Required. The parent resource where this catalog will be created.
    /// Format: projects/{project_id}
    pub parent: std::string::String,

    /// Optional. The view of the catalog to return.
    pub view: crate::model::list_iceberg_catalogs_request::CatalogView,

    /// Optional. The maximum number of catalogs to return. The service may return
    /// fewer than this value.
    pub page_size: i32,

    /// Optional. The page token, received from a previous `ListIcebergCatalogs`
    /// call. Provide this to retrieve the subsequent page.
    pub page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListIcebergCatalogsRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListIcebergCatalogsRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [view][crate::model::ListIcebergCatalogsRequest::view].
    pub fn set_view<
        T: std::convert::Into<crate::model::list_iceberg_catalogs_request::CatalogView>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.view = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListIcebergCatalogsRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListIcebergCatalogsRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListIcebergCatalogsRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.ListIcebergCatalogsRequest"
    }
}

/// Defines additional types related to [ListIcebergCatalogsRequest].
pub mod list_iceberg_catalogs_request {
    #[allow(unused_imports)]
    use super::*;

    /// The enumeration of the views that can be returned.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum CatalogView {
        /// Default/unset value. Same as BASIC.
        Unspecified,
        /// Include only the name and catalog type.
        Basic,
        /// Include all fields of the catalog.
        Full,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [CatalogView::value] or
        /// [CatalogView::name].
        UnknownValue(catalog_view::UnknownValue),
    }

    #[doc(hidden)]
    pub mod catalog_view {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl CatalogView {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Basic => std::option::Option::Some(1),
                Self::Full => std::option::Option::Some(2),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("CATALOG_VIEW_UNSPECIFIED"),
                Self::Basic => std::option::Option::Some("CATALOG_VIEW_BASIC"),
                Self::Full => std::option::Option::Some("CATALOG_VIEW_FULL"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for CatalogView {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for CatalogView {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for CatalogView {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Basic,
                2 => Self::Full,
                _ => Self::UnknownValue(catalog_view::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for CatalogView {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "CATALOG_VIEW_UNSPECIFIED" => Self::Unspecified,
                "CATALOG_VIEW_BASIC" => Self::Basic,
                "CATALOG_VIEW_FULL" => Self::Full,
                _ => Self::UnknownValue(catalog_view::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for CatalogView {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Basic => serializer.serialize_i32(1),
                Self::Full => serializer.serialize_i32(2),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for CatalogView {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<CatalogView>::new(
                ".google.cloud.biglake.v1.ListIcebergCatalogsRequest.CatalogView",
            ))
        }
    }
}

/// The response message for the `ListIcebergCatalogs` API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListIcebergCatalogsResponse {
    /// Output only. The list of iceberg catalogs.
    pub iceberg_catalogs: std::vec::Vec<crate::model::IcebergCatalog>,

    /// Output only. The next page token for pagination.
    pub next_page_token: std::string::String,

    /// Output only. The list of unreachable cloud regions for router fanout.
    pub unreachable: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListIcebergCatalogsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [iceberg_catalogs][crate::model::ListIcebergCatalogsResponse::iceberg_catalogs].
    pub fn set_iceberg_catalogs<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::IcebergCatalog>,
    {
        use std::iter::Iterator;
        self.iceberg_catalogs = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListIcebergCatalogsResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }

    /// Sets the value of [unreachable][crate::model::ListIcebergCatalogsResponse::unreachable].
    pub fn set_unreachable<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.unreachable = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for ListIcebergCatalogsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.ListIcebergCatalogsResponse"
    }
}

/// Request message for FailoverIcebergCatalog.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FailoverIcebergCatalogRequest {
    /// Required. The name of the catalog in the form
    /// "projects/{project_id}/catalogs/{catalog_id}"
    pub name: std::string::String,

    /// Required. The region being assigned as the new primary replica region. For
    /// example "us-east1". This must be one of the replica regions in the
    /// catalog's list of replicas marked as a "secondary".
    pub primary_replica: std::string::String,

    /// Optional. If set, only validate the request, but do not perform the update.
    /// This can be used to inspect the replication_time at any time, including
    /// before performing a fail-over.
    pub validate_only: bool,

    /// Optional. If unset, wait for all data from the source region to replicate
    /// to the new primary region before completing the failover, with no data loss
    /// (also called "soft failover"). If set, failover immediately, accepting the
    /// loss of any data committed in the source region after this timestamp, that
    /// has not yet replicated. If any data committed before this time has not
    /// replicated, the failover will not be performed and an error will be
    /// returned (also called "hard failover").
    pub conditional_failover_replication_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl FailoverIcebergCatalogRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::FailoverIcebergCatalogRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [primary_replica][crate::model::FailoverIcebergCatalogRequest::primary_replica].
    pub fn set_primary_replica<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.primary_replica = v.into();
        self
    }

    /// Sets the value of [validate_only][crate::model::FailoverIcebergCatalogRequest::validate_only].
    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.validate_only = v.into();
        self
    }

    /// Sets the value of [conditional_failover_replication_time][crate::model::FailoverIcebergCatalogRequest::conditional_failover_replication_time].
    pub fn set_conditional_failover_replication_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.conditional_failover_replication_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [conditional_failover_replication_time][crate::model::FailoverIcebergCatalogRequest::conditional_failover_replication_time].
    pub fn set_or_clear_conditional_failover_replication_time<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.conditional_failover_replication_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for FailoverIcebergCatalogRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.FailoverIcebergCatalogRequest"
    }
}

/// Response message for FailoverIcebergCatalog.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FailoverIcebergCatalogResponse {
    /// Output only. The min timestamp for which all namespaces and table metadata
    /// have been replicated in the region specified as the new primary_replica.
    /// Some resources may have been replicated more recently than this timestamp.
    /// If empty, the replica has just been created and has not yet been fully
    /// initialized. NOTE: When the Cloud Storage replication watermark is
    /// available, this will represent both catalog metadata and Cloud Storage
    /// data.
    pub replication_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl FailoverIcebergCatalogResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [replication_time][crate::model::FailoverIcebergCatalogResponse::replication_time].
    pub fn set_replication_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.replication_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [replication_time][crate::model::FailoverIcebergCatalogResponse::replication_time].
    pub fn set_or_clear_replication_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.replication_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for FailoverIcebergCatalogResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.FailoverIcebergCatalogResponse"
    }
}

/// The update message for the `UpdateIcebergTable` API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateIcebergTableRequest {
    /// Required. Table to commit in the format:
    /// `projects/{project_id}/namespaces/{namespace}/tables/{table}`.
    pub name: std::string::String,

    /// Required. The request body that should be in the format of Apache Iceberg's
    /// `#/components/schemas/CommitTableRequest`. Content type is expected to be
    /// `application/json`. Added this field for easier json parsing.
    pub http_body: std::option::Option<api::model::HttpBody>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateIcebergTableRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::UpdateIcebergTableRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [http_body][crate::model::UpdateIcebergTableRequest::http_body].
    pub fn set_http_body<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<api::model::HttpBody>,
    {
        self.http_body = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [http_body][crate::model::UpdateIcebergTableRequest::http_body].
    pub fn set_or_clear_http_body<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<api::model::HttpBody>,
    {
        self.http_body = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateIcebergTableRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.UpdateIcebergTableRequest"
    }
}

/// The request message for the `GetIcebergTable` API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetIcebergTableRequest {
    /// Required. Table to get in the format:
    pub name: std::string::String,

    /// Optional. What snapshot to get. Valid only for GetIcebergTable.
    pub snapshots: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetIcebergTableRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetIcebergTableRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [snapshots][crate::model::GetIcebergTableRequest::snapshots].
    pub fn set_snapshots<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.snapshots = v.into();
        self
    }
}

impl wkt::message::Message for GetIcebergTableRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.GetIcebergTableRequest"
    }
}

/// The request message for the `DeleteIcebergTable` API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteIcebergTableRequest {
    /// Required. Table to delete in the format:
    /// `projects/{project_id}/namespaces/{namespace}/tables/{table}`.
    pub name: std::string::String,

    /// Optional. If true we'll delete both the table and the data. Currently
    /// purgin data is not supported.
    pub purge_requested: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteIcebergTableRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteIcebergTableRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [purge_requested][crate::model::DeleteIcebergTableRequest::purge_requested].
    pub fn set_purge_requested<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.purge_requested = v.into();
        self
    }
}

impl wkt::message::Message for DeleteIcebergTableRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.DeleteIcebergTableRequest"
    }
}

/// The request message for the `CreateIcebergTable` API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateIcebergTableRequest {
    /// Required. The parent resource where this table will be created.
    /// Format: projects/{project_id}/namespaces/{namespace}
    pub parent: std::string::String,

    /// Required. The request body that should be in the format of Apache Iceberg's
    /// `#/components/schemas/CreateTableRequest`. Content type is expected to be
    /// `application/json`.
    pub http_body: std::option::Option<api::model::HttpBody>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateIcebergTableRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateIcebergTableRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [http_body][crate::model::CreateIcebergTableRequest::http_body].
    pub fn set_http_body<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<api::model::HttpBody>,
    {
        self.http_body = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [http_body][crate::model::CreateIcebergTableRequest::http_body].
    pub fn set_or_clear_http_body<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<api::model::HttpBody>,
    {
        self.http_body = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreateIcebergTableRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.CreateIcebergTableRequest"
    }
}

/// The request message for the `ListIcebergTableIdentifiers` API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListIcebergTableIdentifiersRequest {
    /// Optional. PageToken for pagination.
    pub page_token: std::string::String,

    /// Optional. Page size for pagination.
    pub page_size: i32,

    /// Required. The namespace to list tables from.
    pub parent: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListIcebergTableIdentifiersRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [page_token][crate::model::ListIcebergTableIdentifiersRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListIcebergTableIdentifiersRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [parent][crate::model::ListIcebergTableIdentifiersRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }
}

impl wkt::message::Message for ListIcebergTableIdentifiersRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.ListIcebergTableIdentifiersRequest"
    }
}

/// The table identifier.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TableIdentifier {
    /// The namespace of the table. This is always 1 element, since we don't
    /// support nested namespaces.
    pub namespace: std::vec::Vec<std::string::String>,

    /// The table name.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl TableIdentifier {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [namespace][crate::model::TableIdentifier::namespace].
    pub fn set_namespace<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.namespace = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [name][crate::model::TableIdentifier::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for TableIdentifier {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.TableIdentifier"
    }
}

/// The response message for the `ListIcebergTableIdentifiers` API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListIcebergTableIdentifiersResponse {
    /// Output only. The list of table identifiers.
    pub identifiers: std::vec::Vec<crate::model::TableIdentifier>,

    /// Output only. The next page token for pagination.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListIcebergTableIdentifiersResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [identifiers][crate::model::ListIcebergTableIdentifiersResponse::identifiers].
    pub fn set_identifiers<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::TableIdentifier>,
    {
        use std::iter::Iterator;
        self.identifiers = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListIcebergTableIdentifiersResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListIcebergTableIdentifiersResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.ListIcebergTableIdentifiersResponse"
    }
}

/// The request message for the `UpdateIcebergNamespace` API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IcebergNamespaceUpdate {
    /// Optional. Keys of the properties to remove.
    pub removals: std::vec::Vec<std::string::String>,

    /// Optional. List of properties to update or add.
    pub updates: std::collections::HashMap<std::string::String, std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl IcebergNamespaceUpdate {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [removals][crate::model::IcebergNamespaceUpdate::removals].
    pub fn set_removals<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.removals = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [updates][crate::model::IcebergNamespaceUpdate::updates].
    pub fn set_updates<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.updates = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }
}

impl wkt::message::Message for IcebergNamespaceUpdate {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.IcebergNamespaceUpdate"
    }
}

/// The request message for the `UpdateIcebergNamespace` API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateIcebergNamespaceRequest {
    /// Required. The namespace to update.
    ///
    /// The namespace's `name` field is used to identify the namespace to update.
    /// Format: projects/{project_id}/namespaces/{namespace}
    pub name: std::string::String,

    /// Required. The update to apply to the namespace.
    pub iceberg_namespace_update: std::option::Option<crate::model::IcebergNamespaceUpdate>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateIcebergNamespaceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::UpdateIcebergNamespaceRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [iceberg_namespace_update][crate::model::UpdateIcebergNamespaceRequest::iceberg_namespace_update].
    pub fn set_iceberg_namespace_update<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::IcebergNamespaceUpdate>,
    {
        self.iceberg_namespace_update = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [iceberg_namespace_update][crate::model::UpdateIcebergNamespaceRequest::iceberg_namespace_update].
    pub fn set_or_clear_iceberg_namespace_update<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::IcebergNamespaceUpdate>,
    {
        self.iceberg_namespace_update = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateIcebergNamespaceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.UpdateIcebergNamespaceRequest"
    }
}

/// The response message for the `UpdateIcebergNamespace` API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateIcebergNamespaceResponse {
    /// Output only. List of properties that were removed.
    pub removed: std::vec::Vec<std::string::String>,

    /// Output only. List of properties that were added or updated.
    pub updated: std::vec::Vec<std::string::String>,

    /// Output only. List of properties that were requested to be removed, but were
    /// not found.
    pub missing: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateIcebergNamespaceResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [removed][crate::model::UpdateIcebergNamespaceResponse::removed].
    pub fn set_removed<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.removed = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [updated][crate::model::UpdateIcebergNamespaceResponse::updated].
    pub fn set_updated<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.updated = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [missing][crate::model::UpdateIcebergNamespaceResponse::missing].
    pub fn set_missing<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.missing = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for UpdateIcebergNamespaceResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.UpdateIcebergNamespaceResponse"
    }
}

/// The request message for the `DeleteIcebergNamespace` API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteIcebergNamespaceRequest {
    /// Required. Iceberg namespace to delete in the format:
    /// `projects/{project_id}/namespaces/{namespace}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteIcebergNamespaceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteIcebergNamespaceRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for DeleteIcebergNamespaceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.DeleteIcebergNamespaceRequest"
    }
}

/// The namespace object to create.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IcebergNamespace {
    /// Required. The name of the namespace.
    pub namespace: std::vec::Vec<std::string::String>,

    /// Optional. The optional properties of the namespace.
    pub properties: std::collections::HashMap<std::string::String, std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl IcebergNamespace {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [namespace][crate::model::IcebergNamespace::namespace].
    pub fn set_namespace<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.namespace = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [properties][crate::model::IcebergNamespace::properties].
    pub fn set_properties<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.properties = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }
}

impl wkt::message::Message for IcebergNamespace {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.IcebergNamespace"
    }
}

/// The request message for the `CreateIcebergNamespace` API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateIcebergNamespaceRequest {
    /// Required. The parent resource where this namespace will be created.
    /// Format: projects/{project_id}/restcatalog/v1/catalogs/{catalog_id}
    pub parent: std::string::String,

    /// Required. The namespace to create.
    pub iceberg_namespace: std::option::Option<crate::model::IcebergNamespace>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateIcebergNamespaceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateIcebergNamespaceRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [iceberg_namespace][crate::model::CreateIcebergNamespaceRequest::iceberg_namespace].
    pub fn set_iceberg_namespace<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::IcebergNamespace>,
    {
        self.iceberg_namespace = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [iceberg_namespace][crate::model::CreateIcebergNamespaceRequest::iceberg_namespace].
    pub fn set_or_clear_iceberg_namespace<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::IcebergNamespace>,
    {
        self.iceberg_namespace = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreateIcebergNamespaceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.CreateIcebergNamespaceRequest"
    }
}

/// The request message for the `GetIcebergCatalogConfig` API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetIcebergCatalogConfigRequest {
    /// Required. Warehouse location or identifier to request from the service.
    pub warehouse: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetIcebergCatalogConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [warehouse][crate::model::GetIcebergCatalogConfigRequest::warehouse].
    pub fn set_warehouse<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.warehouse = v.into();
        self
    }
}

impl wkt::message::Message for GetIcebergCatalogConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.GetIcebergCatalogConfigRequest"
    }
}

/// The iceberg catalog configuration.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IcebergCatalogConfig {
    /// Output only. Properties that should be used to override client
    /// configuration; applied after defaults and client configuration. Required,
    /// even if empty.
    pub overrides: std::collections::HashMap<std::string::String, std::string::String>,

    /// Output only. Properties that should be used as default configuration;
    /// applied before client configuration. Required, even if empty.
    pub defaults: std::collections::HashMap<std::string::String, std::string::String>,

    /// Output only. Endpoints, required, must not be empty.
    pub endpoints: std::vec::Vec<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl IcebergCatalogConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [overrides][crate::model::IcebergCatalogConfig::overrides].
    pub fn set_overrides<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.overrides = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [defaults][crate::model::IcebergCatalogConfig::defaults].
    pub fn set_defaults<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.defaults = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }

    /// Sets the value of [endpoints][crate::model::IcebergCatalogConfig::endpoints].
    pub fn set_endpoints<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.endpoints = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for IcebergCatalogConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.IcebergCatalogConfig"
    }
}

/// The request message for the `GetIcebergNamespace` API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetIcebergNamespaceRequest {
    /// Required. Iceberg namespace to fetch in the format:
    /// `projects/{project_id}/namespaces/{namespace}`.
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetIcebergNamespaceRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetIcebergNamespaceRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetIcebergNamespaceRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.GetIcebergNamespaceRequest"
    }
}

/// ListIcebergNamespacesRequest
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListIcebergNamespacesRequest {
    /// Optional. PageToken
    pub page_token: std::string::String,

    /// Optional. For servers that support pagination, this signals an upper bound
    /// of the number of results that a client will receive. For servers that do
    /// not support pagination, clients may receive results larger than the
    /// indicated `pageSize`.
    pub page_size: i32,

    /// Required. The parent from the resource path.
    pub api_parent: std::string::String,

    /// Optional. An optional namespace, underneath which to list namespaces. If
    /// not provided or empty, all top-level namespaces should be listed. If parent
    /// is a multipart namespace, the parts must be separated by the unit separator
    /// (`0x1F`) byte.
    /// Not a real parent, so ST_NOT_REQUIRED.
    pub parent: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListIcebergNamespacesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [page_token][crate::model::ListIcebergNamespacesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListIcebergNamespacesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [api_parent][crate::model::ListIcebergNamespacesRequest::api_parent].
    pub fn set_api_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.api_parent = v.into();
        self
    }

    /// Sets the value of [parent][crate::model::ListIcebergNamespacesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }
}

impl wkt::message::Message for ListIcebergNamespacesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.ListIcebergNamespacesRequest"
    }
}

/// The response message for the `ListIcebergNamespaces` API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListIcebergNamespacesResponse {
    /// The list of namespaces.
    pub namespaces: std::vec::Vec<wkt::ListValue>,

    /// The next page token for pagination.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListIcebergNamespacesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [namespaces][crate::model::ListIcebergNamespacesResponse::namespaces].
    pub fn set_namespaces<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<wkt::ListValue>,
    {
        use std::iter::Iterator;
        self.namespaces = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListIcebergNamespacesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListIcebergNamespacesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.ListIcebergNamespacesResponse"
    }
}

/// The storage credential for a path in the table.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StorageCredential {
    /// Indicates a storage location prefix where the credential is relevant.
    pub prefix: std::string::String,

    /// The credentials for the storage location. The keys that are populated are:
    ///
    /// - `gcs.oauth2.token`
    /// - `gcs.oauth2.token_expires_at`
    /// - `expiration-time` (to support federation from Polaris).
    pub config: std::collections::HashMap<std::string::String, std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl StorageCredential {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [prefix][crate::model::StorageCredential::prefix].
    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.prefix = v.into();
        self
    }

    /// Sets the value of [config][crate::model::StorageCredential::config].
    pub fn set_config<T, K, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = (K, V)>,
        K: std::convert::Into<std::string::String>,
        V: std::convert::Into<std::string::String>,
    {
        use std::iter::Iterator;
        self.config = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
        self
    }
}

impl wkt::message::Message for StorageCredential {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.StorageCredential"
    }
}

/// The response message for the `LoadCredentials` API.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LoadIcebergTableCredentialsResponse {
    /// The credentials for the table assigned to the caller.
    pub storage_credentials: std::vec::Vec<crate::model::StorageCredential>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl LoadIcebergTableCredentialsResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [storage_credentials][crate::model::LoadIcebergTableCredentialsResponse::storage_credentials].
    pub fn set_storage_credentials<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::StorageCredential>,
    {
        use std::iter::Iterator;
        self.storage_credentials = v.into_iter().map(|i| i.into()).collect();
        self
    }
}

impl wkt::message::Message for LoadIcebergTableCredentialsResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.cloud.biglake.v1.LoadIcebergTableCredentialsResponse"
    }
}
